@<template>
  <div class="cart-bottom-bar">
      <i @click="selectE"><check-button :checked="select" /><span>全选</span></i>
      <span>合计:￥{{allPrice}}</span>
      <span @click="toPay">去付款:({{choseCount}})</span>
  </div>
</template>

<script>
import CheckButton from 'components/content/checkbutton/CheckButton.vue'
import { mapGetters } from 'vuex'

export default {
    components: {
        CheckButton
    },
    
    props: {
        allPrice:{
            type: String,
            default: "0"
        },

    },
    computed: {
    ...mapGetters(["select","choseCount"]),

    },
    methods: {
        selectE(){
            this.$store.dispatch("buyAll");
            
        },
        toPay() {
            this.$emit('toPay')
        }
    },
    
    

}
</script>

<style>
.cart-bottom-bar {
    background-color: #eaeaea;
    position: fixed;
    height: 30px;
    left: 0;
    right: 0;
    bottom: 50px;
    display: flex;
    align-items: center;
    
}
.cart-bottom-bar i {
    display: flex;
    width: 70px;
    padding-left: 4px;
    align-items: center;
}
.cart-bottom-bar i span {
    padding-left: 3px;
    font-size: 12px;
}
.cart-bottom-bar span:nth-of-type(2) {
    width: 90px;
    background-color: #ff748d;
    height: 100%;
    line-height: 30px;
    text-align: center;
    color: #fff;

}
.cart-bottom-bar span:nth-of-type(1) {
    
    flex:1;
    margin-left: 4px;
}


</style>